package com.fangcang.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fangcang.rest.RestService;
import com.fangcang.rest.business.BaseBusinessResponse;
import com.fangcang.rest.city.BaseCityResponse;
import com.fangcang.rest.country.BaseCountryResponse;
import com.fangcang.rest.district.BaseDistrictResponse;
import com.fangcang.rest.hotel.Hotel;
import com.fangcang.rest.hotelinfo.BaseHotelInfoResponse;

@RestController
@RequestMapping("rest/")
public class RestTestController {
	
	@Autowired
	private RestService restService;

	@RequestMapping("syncCoutryList")
	public BaseCountryResponse syncCoutryList() {
			try {
				return restService.syncCoutryList();
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
	}
	
	
	@RequestMapping("syncCityList")
	public BaseCityResponse syncCityList() {
		try {
			return restService.syncCityList();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	@RequestMapping("syncDistrictList")
	public BaseDistrictResponse syncDistrictList() {
		try {
			return restService.syncDistrict();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	@RequestMapping("syncBusinessList")
	public BaseBusinessResponse syncBusinessList() {
		try {
			return restService.syncBusinessList();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	@RequestMapping("syncHotelList")
	public List<Hotel> syncHotelList() {
		try {
			return restService.syncHotelList();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	@RequestMapping("syncHotelInfo")
	public BaseHotelInfoResponse syncHotelInfo() {
		try {
			return restService.syncHotelInfo();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
